package com.example.usergroup.model;

import com.example.mvvmcommon.mvvm.model.BaseModel;
import com.example.networkmoudel.ChangeFunction;
import com.example.networkmoudel.HttpFactory;
import com.example.networkmoudel.HttpType;
import com.example.networkmoudel.entity.BaseEntity;
import com.example.usergroup.data.Api;
import com.example.usergroup.data.entity.UserEntity;

import java.util.Map;

import io.reactivex.Observable;

public class LoginModel extends BaseModel {
    public Observable<BaseEntity> requestLogin(Map<String,Object>map){
        return HttpFactory.getInstance().factory(HttpType.TOKENSIGNTYPE)
                .getRetrofit().create(Api.class)
                .requestLogin(cteateBody(map))
                .map(new ChangeFunction<UserEntity>());
    }
}
